<?php
/**
 * /*


INSERT INTO  `hzk`.`t_message` (
`id` ,
`usename` ,
`sex` ,
`content` ,
`avater` ,
`time_ai`
)
VALUES (
NULL ,  '$usename',  '$sex',  '$message',  '$imgurl',  $time_ai'
);*/
 
//echo "<pre>";
//print_r($_POST);
/*
INSERT INTO  `hzk`.`t_message` (
`id` ,
`usename` ,
`sex` ,
`content` ,
`avater` ,
`time_ai`
)
VALUES (
NULL ,  '手机',  '',  '呵呵',  'images/2.jpg',  ''
);
 */

//header("content-type:text/html;charset=utf-8");
require_once "shuju.php";
$conn;
$usename = $_POST['username'];
$sex = $_POST['sex'];
$message = $_POST['message'];
$imgurl = $_POST['imgurl'];
$time_ai = time();

$sql ="
INSERT INTO  `hzk`.`t_message` (
`id` ,
`usename` ,
`sex` ,
`content` ,
`avater` ,
`time_ai`
)
VALUES (
NULL ,  '$usename',  '$sex',  '$message',  '$imgurl',  '$time_ai'
);

";

$result = $conn->query($sql);
if ($result===false){
    echo " 失败";
}else{
header("Location:index.php");
}

